import { createApp } from 'vue'
import { Quasar } from 'quasar'
import quasarLang from 'quasar/lang/zh-CN'

// Import icon libraries
import '@quasar/extras/material-icons/material-icons.css'

// Import Quasar css
import 'quasar/src/css/index.sass'
import { Cookies, Dark, Notify, LocalStorage } from "quasar"

import "@/css/amtf-scss.scss"

import "amtf-vc/src/css/theme-default/index.less"
import avc from 'amtf-vc/index';

import "vue-easytable/libs/theme-default/index.css";
// // 引入组件库
// import VueEasytable from "vue-easytable";

import App from './App.vue'

import { createPinia } from 'pinia'
const pinia = createPinia()

import router from './router'

const app = createApp(App)
app.use(Quasar, {
  plugins: {
    Dark,
    Cookies,
    Notify,
    LocalStorage,
  }, // import Quasar plugins and add here
  lang: quasarLang,
  /*
  config: {
    brand: {
      // primary: '#e46262',
      // ... or all other brand colors
    },
    notify: {...}, // default set of options for Notify Quasar plugin
    loading: {...}, // default set of options for Loading Quasar plugin
    loadingBar: { ... }, // settings for LoadingBar Quasar plugin
    // ..and many more (check Installation card on each Quasar component/directive/plugin)
  }
  */
})

app.use(router)
app.use(pinia)
app.use(avc)
// app.use(VueEasytable)

app.directive("a全选", (el) => {
  let it = el.querySelector('.q-field__native')
  it.addEventListener('focus', () => {
    if (it.value.length) {
      it.select()
    }
  })
});

app.mount('#app')
